<%@ include file="/common/taglibs.jsp"%>
 <%@ page pageEncoding="utf-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head> 
<title>角色授权</title>
<link href="<c:url value="/styles/css.css"/>" rel="stylesheet" type="text/css" />
<link href="../styles/layout.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F4F4F4;
}
-->
</style>
<script src="<c:url value='/scripts/common.js'/>"></script>
<SCRIPT LANGUAGE="JAVASCRIPT">
var msg = "<c:out value="${message}"/>";
if(null!=msg && "success"==msg){
	alert("数据保存成功");
	window.close();
}
</SCRIPT>
</head>
<body> 
<bean:define id="form" name="userInfoBean" type="com.sasis.webapp.form.UserInfoBean"/> 
<html:form action="/manage/userRoleSet.shtml" styleId="userInfoBean"  method="post" > 

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left" valign="top">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="31"><table border="0" cellspacing="0" cellpadding="0">
          <tr>
             <td class="home-content-title" ><img src="../images/passenger.gif" width="21" height="22" align="absmiddle"/>角色授权</td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="left" valign="top">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="30" align="left" background="../images/list_title_bg.jpg"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td align="left" valign="bottom" class="home-table-tool-content">
                <input  type="button"   class="home-inputBtn" value="<fmt:message key="button.save"/>" onclick="javascript:selected();formSubmit(document.forms[0],'./userRoleSetAdd.shtml?action=userRoleAdd'); ">
                <input  type="button"   class="home-inputBtn" value="<fmt:message key="button.close"/>" onclick="window.close();"/>
              </tr>
            </table></td>
          </tr>
        </table>
     </td>   
   </tr>

   <tr> 
        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"  class="home-subtable-bgcolor" id="assignId">
           <tr>
           	<td class="home-edittable-space">&nbsp;&nbsp;<font color1="blue">授权给用户:</font>&nbsp;&nbsp;<font color="red"><c:out value="${param.userId}"/></font></td>
           </tr>	
            <tr>
               
              <td align="left" valign="top" class="area-brown-whiteline"><table width="50%" border="0" cellspacing="0" cellpadding="0" align="center">
                  <tr>
                    <td width="2%">&nbsp;</td>
                    <td width="20%">&nbsp;</td>
                    <td width="17%">&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>
                    <html:select property="roleId" multiple="true"  style="width:15em;height: 180px;">
                    	 <c:if test="${null!=roleList}">
							<html:optionsCollection name="roleList"/>
		 				 </c:if>							
					</html:select> 
					</td>
                    <td><table width="100%" border="0" cellspacing="0" cellpadding="0" >
                        <tr>
                          <td align="center"><table width="42" border="0" cellspacing="0" cellpadding="0"  >
                              <tr>
                               <td align="center">  <input  type="button"   class="home-inputBtn" value=">>>" onClick="addItem(document.all.roleId,document.all.roleName)"></td>
                              </tr>
                          </table></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                        </tr> 
                        <tr>
                          <td align="center"><table width="42" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                               <td align="center">  <input  type="button"   class="home-inputBtn" value="<<<" onClick="delItem(document.all.roleId,document.all.roleName)""></td>
                              </tr>
                          </table></td>
                        </tr>
                    </table></td>
                    <td><html:select property="roleName" multiple="true" style="width:15em;height: 180px;" >
							<html:optionsCollection name="rtRoleList" />
						</html:select>
				 </td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
              </table></td>
            </tr>  
 </table> 
<html:hidden property="aryId"/> 
<html:hidden property="seledId"/> 
</html:form>
<script> 
 	function selected(){
		var len =  document.forms[0].roleName.options.length; 
		 
		var ary = new Array();
		for(i=0;i<len;i++){
			var aa = document.forms[0].roleName.options[i].value;
			
			ary.push(aa);
 
		}
					document.forms[0].aryId.value = ary;
 	}
</script> 
<p>

<font color="red">
 
<html:errors/><br>
 
</font> 
<!-- Support for non-traditional but simpler use of errors... -->
<logic:present name="errors">
  <logic:iterate id="error" name="errors">
      <li><font color="red"><bean:write name="error"/></font></li>
  </logic:iterate>
</logic:present>
</body>
</html>
